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-1+1i, 1-1i, 1-1i, 1-1i, 1-1i,-1+1i, 1+1i, ...
  1+1i,-1-1i, 1+1i,-1+1i,-1+1i,-1-1i, 1+1i, 1+1i, 1+1i,-1-1i, ...
  1+1i, 1-1i, 1-1i, 1-1i,-1+1i,-1+1i,-1+1i,-1+1i, 1-1i,-1-1i, ...
 -1-1i, 1-1i,-1+1i,-1-1i,-1-1i, 1-1i,-1+1i,-1+1i,-1+1i, 1-1i, ...
 -1+1i, 1+1i, 1+1i, 1+1i,-1-1i,-1-1i,-1-1i,-1-1i, 1+1i, 1-1i, 1-1i];

p4_64_p = zeros(1,100);
p4_64_n = zeros(1,100);
k=1:1:25;
p4_64_p(4*k)    = 2.*( conj(pall(4*k+101)) );
p4_64_n(101-4*k)= 2.*( conj(pall(101-4*k)) );
p4_64 = [0, p4_64_p, zeros(1, 55) p4_64_n];
%preall  = [0, pall(102:201), zeros(1, 55) pall(1:100)];
pre64 = 16 .* ifft(p4_64,256);


peven_p = zeros(1,100);
peven_n = zeros(1,100);
k=1:1:50;
peven_p(2*k)    = sqrt(2).*( (pall(2*k+101)) );
peven_n(101-2*k)= sqrt(2).*( (pall(101-2*k)) );
peven = [0, peven_p, zeros(1, 55) peven_n];
pre128 = 16 .* ifft(peven,256);

DL_preamble = [pre64(256-CP+1:256), pre64, pre128(256-CP+1:256), pre128];
UL_preamble = [pre128(256-CP+1:256), pre128];

%chk = [ preall.', peven.', p4_64.'];
